package com.kefu.call.vo;

import java.util.Date;
import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.call.model.CdrCallhistory;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2022/07/26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "计费_话费扣除历史")
public class CdrCallhistorySearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "线路号")
    private String linenumber;
    @ApiModelProperty(value = "被叫号码")
    private String callednumber;
    @ApiModelProperty(value = "创建时间")
    private Date createtime;
    @ApiModelProperty(value = "产生的费用")
    private String callcost;
    @ApiModelProperty(value = "呼叫分钟")
    private String calltime;
    @ApiModelProperty(value = "是否在套餐内")
    private Boolean issetmeal;
    @ApiModelProperty(value = "呼叫id")
    private String callid;
    @ApiModelProperty(value = "公司id")
    private String company;
    @ApiModelProperty(value = "之前的金额")
    private String beforemoney;
    @ApiModelProperty(value = "扣除后余额")
    private String deductmoney;
    @ApiModelProperty(value = "扣除钱免费通话时间")
    private String beforetime;
    @ApiModelProperty(value = "扣除后免费通话时间")
    private String deducttime;

	 @Override
    public  LambdaQueryWrapper<CdrCallhistory> lambdaQuery(){
    	LambdaQueryWrapper<CdrCallhistory> wrapper=Wrappers.<CdrCallhistory>lambdaQuery();
	    wrapper.eq(StringUtils.isNotBlank(linenumber), CdrCallhistory::getLinenumber, linenumber);//线路号
	    wrapper.eq(StringUtils.isNotBlank(callednumber), CdrCallhistory::getCallednumber, callednumber);//被叫号码
		wrapper.eq(createtime!=null, CdrCallhistory::getCreatetime, createtime);//创建时间
	    wrapper.eq(StringUtils.isNotBlank(callcost), CdrCallhistory::getCallcost, callcost);//产生的费用
	    wrapper.eq(StringUtils.isNotBlank(calltime), CdrCallhistory::getCalltime, calltime);//呼叫分钟
		wrapper.eq(issetmeal!=null, CdrCallhistory::getIssetmeal, issetmeal);//是否在套餐内
	    wrapper.eq(StringUtils.isNotBlank(callid), CdrCallhistory::getCallid, callid);//呼叫id
	    wrapper.eq(StringUtils.isNotBlank(company), CdrCallhistory::getCompany, company);//公司id
	    wrapper.eq(StringUtils.isNotBlank(beforemoney), CdrCallhistory::getBeforemoney, beforemoney);//之前的金额
	    wrapper.eq(StringUtils.isNotBlank(deductmoney), CdrCallhistory::getDeductmoney, deductmoney);//扣除后余额
	    wrapper.eq(StringUtils.isNotBlank(beforetime), CdrCallhistory::getBeforetime, beforetime);//扣除钱免费通话时间
	    wrapper.eq(StringUtils.isNotBlank(deducttime), CdrCallhistory::getDeducttime, deducttime);//扣除后免费通话时间
	    
    	return wrapper;
	}
}